<template>
    <view class="container">
        <uni-nav-bar
            dark
            color="#fff"
            shadow
            status-bar
            left-icon="left"
            title="加载列表示例"
            fixed
            @clickLeft="$router.back()"
        />
        <view
            class="list"
            :style="{height: `calc(100vh - ${statusBarHeight + 44}px)`}"
        >
            <LoadMoreList
                ref="loadMoreListRef"
                :options="options"
            >
                <template #default="scope">
                    <view class="activity-li">
                        {{ scope.row.entName }}
                    </view>
                </template>
            </LoadMoreList>
        </view>
    </view>
</template>

<script setup>
    import { onLoad, onShow } from '@dcloudio/uni-app';
    import { ref, reactive, inject } from 'vue';
    import LoadMoreList from '@/components/LoadMoreList.vue';
    
    const storage = inject('$storage');
    let statusBarHeight = ref(storage.get('statusBarHeight'));
    
    // 列表
    let loadMoreListRef = ref(null);

    // 列表查询配置项
    let options = reactive({
        url: '/base-server/organization/sysNetworkOrganization/pcPageList',
        params: {
            superviseId: "6"
        },
        list: 'records',
        noListText: '没有数据',
        pageSize: 20,
        pagination: {
            page: 'page',
            pageSize: 'pageSize'
        }
    });
</script>

<style lang="less" scoped>
    .container{
        height: 100vh;
        background: #f8f8f8;
    }
    .activity-li{
        height: 100rpx;
        line-height: 100rpx;
        background: #FFFFFF;
        margin: 0 24rpx 24rpx;
        padding: 0 24rpx;
    }
</style>
